fix: route share-by-email link to correct dashboard path by type#5168
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5168 +/- ##
============================================
+ Coverage 43.43% 43.65% +0.21%
Complexity 2216 2216
============================================
Files 1049 1049
Lines 40575 40580 +5
Branches 4321 4324 +3
============================================
+ Hits 17625 17715 +90
+ Misses 21855 21766 -89
- Partials 1095 1099 +4
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
`ShareAccessComponent.grantAccess` hard-coded the `dashboard/user/workflow/` path segment when constructing the share- notification email's "access the ... at ..." URL, regardless of which resource type the dialog was opened for. Because the dialog is opened with `type: "dataset"` / `type: "project"` / `type: "workflow"` from the respective list-item components, the link in the email for shared datasets and shared projects pointed at the workflow route and 404'd on click. Branch on `this.type` to pick the correct route from the existing `app-routing.constant.ts` constants (`DASHBOARD_USER_WORKFLOW`, `DASHBOARD_USER_DATASET`, `DASHBOARD_USER_PROJECT`). `computing-unit` is unaffected — the existing guard already skips the URL line for it. The issue mentioned the dataset case only; the project case has the same defect and is fixed by the same change. Closes apache#5163. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
35e67fc to
2ad00c3
Compare
aglinxinyuan
approved these changes
May 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
ShareAccessComponent.grantAccesshard-coded thedashboard/user/workflow/path segment when constructing the share-notification email's "access the ... at ..." URL, regardless of which resource type the dialog was opened for. Because the dialog is opened withtype: "dataset"/type: "project"/type: "workflow"from the respective list-item components, the link in the email for shared datasets and shared projects pointed at the workflow route and 404'd on click.Branch on
this.typeto pick the correct route from the existingapp-routing.constant.tsconstants:workflow→DASHBOARD_USER_WORKFLOW(/dashboard/user/workflow)dataset→DASHBOARD_USER_DATASET(/dashboard/user/dataset)project→DASHBOARD_USER_PROJECT(/dashboard/user/project)computing-unitis unaffected — the existingif (this.type !== "computing-unit")guard already skips the URL line for that type.Note: the issue mentioned the dataset case only; the project case has the same defect and is fixed by the same change.
Any related issues, documentation, discussions?
Closes #5163.
Follow-up to #4200 (which fixed the missing
/dashboard/user/prefix on the same line per #3583); this fixes the remaining hard-codedworkflowsegment.How was this PR tested?
Added
share-access.component.spec.ts(Vitest + TestBed +HttpClientTestingModule) with four cases that exercisegrantAccess:type=workflow, id=11 → email message contains/dashboard/user/workflow/11type=dataset, id=22 → email message contains/dashboard/user/dataset/22type=project, id=33 → email message contains/dashboard/user/project/33type=computing-unit, id=44 → email message does NOT contain/dashboard/user/Each case mocks the component's injected dependencies (
ShareAccessService,UserService,GmailService,NotificationService,NzMessageService,NzModalService,NzModalRef,WorkflowPersistService,DatasetService,WorkflowActionService,NZ_MODAL_DATA), runsgrantAccess, and inspects the message passed togmailService.sendEmailto confirm the URL formatting.Verified locally:
yarn test --include='**/share-access.component.spec.ts'— 4 passed.yarn prettier --check src/app/dashboard/component/user/share-access/share-access.component.{ts,spec.ts}— clean.Manual verification path:
https://<host>/dashboard/user/dataset/<did>and resolve to the dataset detail page on click./dashboard/user/project/<pid>./dashboard/user/workflow/<wid>(unchanged behavior).Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (claude-opus-4-7)